<?php echo $this->Html->script('Medico'); ?>
<?php echo $this->Html->css('upload'); ?>
<div id="msg"></div>
<form action="/siscel/medicos/cadastrar" id="MEDICOCadastrarForm" method="post" enctype="multipart/form-data">
    <fieldset>
        <legend>Médicos</legend>
        <input type="hidden" name="_method" value="POST"/>
        <table width="98%" border="0" cellspacing="0" cellpadding="2">
            <thead>
                <th colspan="5">
                    <b>INFORMAÇÕES BÁSICAS</b>
                </th>
            </thead>
            <tr>
                <td colspan="3">
                    <?php echo $this->Form->input('USUARIO.NM_AUT', array('type' => 'text', 'label' => 'Nome', 'id' => 'txtNome', 'class' => 'campoAlfa', 'size' => "30", 'maxlength' => "120")); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Medicos.DT_NASC', array('type' => 'text', 'label' => 'Nascimento', 'id' => 'txtDTNASC', 'class' => 'campoData', 'size' => "20", 'maxlength' => "14")); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('USUARIO.SEXO', array('type' => 'select', 'label' => 'Sexo', 'id' => 'txtSexo', 'options' => array('' => '', 'M' => 'Masculino', 'F' => 'Feminino', 'N' => 'Não Informado'))); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $this->Form->input('Medicos.CPF_MEDIC', array('type' => 'text', 'label' => 'CPF', 'id' => 'txtCDLOGIN', 'class' => 'campoCPF', 'size' => "14", 'maxlength' => "14", 'onblur'=>'Medico.verificaCPFMedico(this.value);' )); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Medicos.NU_CNSUS', array('type' => 'text', 'label' => 'CNS', 'id' => 'txtCNS', 'class' => '', 'size' => "5", 'maxlength' => "5")); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Medicos.CD_CRM', array('type' => 'text', 'label' => 'CRM', 'id' => 'txtCDCRM', 'class' => 'campoNumerico', 'size' => "10", 'maxlength' => "9")); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Medicos.UF_CRM', array('type' => 'select', 'label' => 'UF', 'id' => 'txtUFCRM', 'class' => '', 'options' => $arrUF)); ?>
                </td>
                <td>
                    <?php echo $this->Form->input('Medicos.ST_MRG', array('type' => 'radio', 'legend' => 'MRG?', 'options' => array('S'=>'Sim','N'=>'Não'), 'checked' => 'N')); ?>
                </td>
            </tr>
            <tr>                 
                <td colspan="2">
                    <?php echo $this->Form->input('USUARIO.DS_EMAIL', array('type' => 'email', 'label' => 'Email principal', 'id' => 'txtEmailPrincipal', 'class' => 'campoEmail', 'size' => "30", 'maxlength' => "120")); ?>
                </td>
                <td colspan="3">
                    <?php echo $this->Form->input('USUARIO.DS_EMAIL_SEC', array('type' => 'email', 'label' => 'Email secundario', 'id' => 'txtEmailSecundario', 'class' => 'campoEmail', 'size' => "30", 'maxlength' => "120")); ?>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <?php echo $this->element('telefone/cadastroFone'); ?>
                </td>
                <td style="text-align: right;" colspan="2">
                    <div>
                        <?php
                        $usuarioRequest = $this->request->data('Usuario');
                        if (!empty($usuarioRequest['IM_FOTO'])) :
                            echo $this->Siscel->foto($usuarioRequest['IM_FOTO']);
                        else:
                            echo $this->Html->image('/img/perfil.jpg', array('width' => '100', 'heigth' => '133', 'label' => null));
                        endif;
                        ?>
                    </div>
                    <div style="float:right">
                        <!-- a href="#upload" class="input upload ">
                            <button type="button">Incluir / Alterar Foto</button -->
                            <?php echo $this->Form->input('Medicos.fotoUsuario', array('type' => 'file', 'size' => '0', 'style' => 'width: 100px;', 'label' => '', 'class' => '')); ?>
                        <!-- /a -->
                    </div>
                </td>
            </tr>
        </table>
        <div class="submit">
            <input id="btCadastrarMedico" type="button" value="Enviar"/>
        </div>    
    </fieldset>
</form>
<script type="text/javascript">
    $(document).ready(function(){
        Medico.init();
    });
</script>